package com.study.springmvc.controller;

import com.study.springmvc.handler.TestHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/test")
public class TestController {

    @Autowired
    private TestHandler testHandler;

    @RequestMapping("/hello")
    public String hello() {
        String traceId = "123456";
        ThreadLocalContext.setTraceId(traceId);
        testHandler.testAsync();
        return "Hello World!";
    }
}
